import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['svg.fonttype'] = 'none'

# 创建数据框架
data = {
    'Round': [10, 20, 30, 40, 50, 60, 70, 80],
    'SPS': [0.1436304576327869,
  0.1538810386958547,
  0.17468877090422272,
  0.1686800154400654,
  0.2148885563571974,
  0.2327462873448388,
  0.22338081111361563,
  0.2239916056595903],
 'OGS': [0.25338231875242506,
  0.40278766201189153,
  0.5400746023400537,
  0.5234472520476886,
  0.5480120625531993,
  0.5787174179097706,
  0.607833020010558,
  0.6296108178499974],
 'ORDP': [0.21007571374534997,
  0.26244801144827495,
  0.20435346360196355,
  0.2369573670307433,
  0.24876750638153902,
  0.21569679527603305,
  0.23709055495609535,
  0.25436353925689986]
}

df = pd.DataFrame(data)

# 绘制数据
plt.figure(figsize=(8, 6))
plt.plot(df['Round'], df['SPS'], marker='s', markersize=10, label='SPS')
plt.plot(df['Round'], df['OGS'], marker='^', markersize=10, label='OGS')
plt.plot(df['Round'], df['ORDP'], marker='*', markersize=10, label='ORDP')

# plt.title('Comparison of SPF and Cplex Algorithms')
plt.xlabel('Avg. Link Capacity', fontsize=14)
plt.ylabel('Resource Utilization (%)', fontsize=14)
plt.legend(fontsize='large')  # 设置图例的字体大小为大

plt.grid(True)
# plt.show()
plt.savefig("output/ru_var_capacity.svg", format="svg")
